home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 20
/
Cream of the Crop 20 (Terry Blount) (1996).iso
/
program
/
n_b_v203.zip
/
DAC_3D.DMO
< prev
next >
Wrap
Text File
|
1996-07-04
|
5KB
|
89 lines
$if 0
┌──────────────────────────╖ PowerBASIC v3.20
┌──┤ DASoft ╟──────────────────────┬──────────────────╖
│ ├──────────────────────────╢ Copyright 1995 │ DATE: 1995-10-01 ╟─╖
│ │ FILE NAME DAC_3D .DMO ║ by ╘════════════════─ ║ ║
│ │ ║ Don Schullian, Jr. ║ ║
│ ╘══════════════════════════╝ ║ ║
│ A license is hereby granted to the holder to use this source code in ║ ║
│ any program, commercial or otherwise, without receiving the express ║ ║
│ permission of the copyright holder and without paying any royalties, ║ ║
│ as long as this code is not distributed in any compilable format. ║ ║
│ IE: source code files, PowerBASIC Unit files, and printed listings ║ ║
╘═╤═════════════════════════════════════════════════════════════════════╝ ║
│ .................................... ║
╘═══════════════════════════════════════════════════════════════════════╝
$endif
'.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°
' ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° °
$INCLUDE "DAS-NB01.INC"
SCREEN 12
COLOR 15, 0
CLS
? "┌────────────────────────────────────────────────────────────────────────────
? "│ DACcolorSet ( Colour$, DacNo?, R?, G?, B? )
? "│ DACcolorSet3D ( Colour$, DACno? )
? "│ DACcolorDATA ( Colour$, Red?, Green?, Blue? )
? "├────────────────────────────────────────────────────────────────────────────
? "│ By setting the DAC and PALETTE you can get good 3D out of the VGA screen.
? "│ This really isn't hard but it helps to "move things around" a bit to make.
? "│ the color numbers more logical. DACcolorDATA is a monster routine that is
? "│ only RGB data. I NEVER load it into a finished program as I pull out the
? "│ numbers, make them into a string then call DACwriteSTR as it is many Kbytes
? "│ cheaper! As DACcolorSet & DACcolorSet3D both call and use DACcolorDATA they
? "│ too are just programming tools to help get things right. They all work and
? "│ work well, it is just the size that bothers me! Anyhow, have a close look
? "│ at how the DAC and PALETTE are arranged in the code. It will tell you a
? "│ whole lot about how easy things can be when you're in control!
? "├────────────────────────────────────────────────────────────────────────────
? "│ fLoadDAScolor$ () loads Red, Green, Blue, Yellow, Grey have a look!
? "└────────────────────────────────────────────────────────────────────────────
'┌────────────────────────────────────
FOR X% = 0 TO 15 '│ set PB's pallet numbers to 1 -> 15
PALETTE X%, X% '│ so it is easier to remember which
NEXT '│ DAC's are setting
'│
DACcolorDATA "WHITE", R?, G?, B? '│ get RGB vals from data
DACset 0, R?, G?, B? '│ 0 = Bright White
DACcolorSet3D "DASRED" , 1 '│ 1 = Red 6 = LtRed 11 = DkRed
DACcolorSet3D "DASGREEN", 2 '│ 2 = Green 7 = LtGreen 12 = DkGreen
DACcolorSet3D "DASBLUE" , 3 '│ 3 = Blue 8 = LtBlue 13 = DkBlue
DACcolorSet3D "DASGOLD" , 4 '│ 4 = Gold 9 = LtGold 14 = DkGold
DACcolorSet3D "DASGREY" , 5 '│ 5 = Grey 10 = LtGrey 15 = DkGrey
'│
REM fLoadDAScolor$ '│ this does the same as the 12 lines
'│ above UNREM it and have a look!
X1% = 50 : X2% = 145 '│ left most column
Y1% = 350 : Y2% = 445 '│
FOR Colour? = 1 TO 5 '│
TriDBox X1%, Y1%, X2%, Y2%, Colour? '│ draw 5 boxes
INCR X1%, 100 '│
INCR X2%, 100 '│
NEXT '│
'│
fAnyKey '│
PALETTE : SCREEN 0 : CLS : END '│ "Put the toys back in the box, Jr."
' ──────────────────────────────────────┴────────────────────────────────────
' ═══════════════════════════════════════════════════════════════════════════
SUB TriDBox ( BYVAL X1%, BYVAL Y1%, BYVAL X2%, BYVAL Y2%, BYVAL Na? ) LOCAL PUBLIC
LOCAL La?, Da?
La? = ( Na? + 5 )
Da? = ( Na? + 10 )
LINE ( X1%, Y1% ) - ( X2%, Y2% ), 15, B ' a black border
FOR Z% = 1 TO 4 '
INCR X1%, 1 : INCR Y1%, 1 '
DECR X2%, 1 : DECR Y2%, 1 '
LINE ( X1%, Y1% ) - ( X2%, Y1% ), La? ' top
LINE ( X1%, Y1% ) - ( X1%, Y2% ), La? ' left side
LINE ( X2%, Y1% ) - ( X2%, Y2% ), Da? ' right side
LINE ( X1%, Y2% ) - ( X2%, Y2% ), Da? ' bottom
IF Z% = 3 THEN SWAP La?, Da?
NEXT
LINE ( X1%+1, Y1%+1 ) - ( X2%-1, Y2%-1 ), Na?, BF
END SUB